# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=sparty
pkgver=0.1
pkgrel=5
groups=('blackarch' 'blackarch-webapp')
pkgdesc='An open source tool written in python to audit web applications using sharepoint and frontpage architecture.'
arch=('any')
url='http://sparty.secniche.org/'
license=('BSD')
depends=('python2')
source=("http://sparty.secniche.org/${pkgname}_v_${pkgver}.tar.gz")
sha512sums=('08c01ba86c3d4233d594b5f685dc9398677c434240ec690dbd5086340867d63468d7d231facd9c3dc54f59c0731fab025dcd9fb2a8d593d19bf2d19821b921cb')

prepare() {
  tar xf sparty_v_0.1.tar

  cd "${pkgname}_v_$pkgver"

  sed -i 's|/usr/bin/python|/usr/bin/python2|' "sparty_v_$pkgver.py"
  sed -i 's|(2,6):|(2,7):|' "sparty_v_$pkgver.py"
}

package() {
  cd "${pkgname}_v_$pkgver"

  install -Dm 755 "${pkgname}_v_$pkgver.py" "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

